.class Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;
.super Ljava/lang/Thread;
.source "ShareToMicroBlog.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/netease/newsreader/activity/ShareToMicroBlog;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "postEditMessage4QQ"
.end annotation


# instance fields
.field private img:Ljava/lang/String;

.field private msg4QQ:Ljava/lang/String;

.field private s:Ljava/lang/String;

.field private t:Ljava/lang/String;

.field final synthetic this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;


# direct methods
.method public constructor <init>(Lcom/netease/newsreader/activity/ShareToMicroBlog;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
    .locals 1
    .parameter
    .parameter "message"
    .parameter "t"
    .parameter "s"
    .parameter "img"

    .prologue
    .line 862
    iput-object p1, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    .line 857
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    .line 853
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->msg4QQ:Ljava/lang/String;

    .line 854
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->t:Ljava/lang/String;

    .line 855
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->s:Ljava/lang/String;

    .line 856
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->img:Ljava/lang/String;

    .line 858
    iput-object p2, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->msg4QQ:Ljava/lang/String;

    .line 859
    iput-object p3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->t:Ljava/lang/String;

    .line 860
    iput-object p4, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->s:Ljava/lang/String;

    .line 861
    iput-object p5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->img:Ljava/lang/String;

    return-void
.end method


# virtual methods
.method public run()V
    .locals 13

    .prologue
    const/4 v12, 0x1

    .line 866
    new-instance v10, Landroid/os/Message;

    invoke-direct {v10}, Landroid/os/Message;-><init>()V

    .line 867
    .local v10, msg:Landroid/os/Message;
    iput v12, v10, Landroid/os/Message;->what:I

    .line 870
    :try_start_0
    new-instance v0, Lcom/netease/newsreader/weibo/QWeiboSyncApi;

    invoke-direct {v0}, Lcom/netease/newsreader/weibo/QWeiboSyncApi;-><init>()V

    .line 871
    .local v0, api:Lcom/netease/newsreader/weibo/QWeiboSyncApi;
    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->msg4QQ:Ljava/lang/String;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-static {v3}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v4, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    invoke-virtual {v3}, Lcom/netease/newsreader/activity/ShareToMicroBlog;->getShortUrl()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    iput-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->msg4QQ:Ljava/lang/String;

    .line 872
    const-string v1, "2ffe39c660f146df91ffb206a9d44bd5"

    .line 873
    .local v1, customKey:Ljava/lang/String;
    const-string v2, "63261cea4dc8b5c74ed5eefc0f149acd"

    .line 874
    .local v2, customSecrect:Ljava/lang/String;
    const-string v11, ""

    .line 876
    .local v11, response:Ljava/lang/String;
    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->img:Ljava/lang/String;

    if-eqz v3, :cond_0

    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->img:Ljava/lang/String;

    const-string v4, ""

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-nez v3, :cond_0

    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->img:Ljava/lang/String;

    invoke-static {v3}, Lcom/netease/newsreader/util/PicUtil;->isLocalPicExit(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_0

    .line 877
    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->t:Ljava/lang/String;

    iget-object v4, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->s:Ljava/lang/String;

    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->msg4QQ:Ljava/lang/String;

    .line 878
    new-instance v6, Ljava/lang/StringBuilder;

    sget-object v7, Lcom/netease/newsreader/util/PicUtil;->phototempDir:Ljava/lang/String;

    invoke-static {v7}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v7

    invoke-direct {v6, v7}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v7, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->img:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v6

    invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    sget-object v7, Lcom/netease/newsreader/weibo/QWeiboType$ResultType;->ResultType_Json:Lcom/netease/newsreader/weibo/QWeiboType$ResultType;

    .line 877
    invoke-virtual/range {v0 .. v7}, Lcom/netease/newsreader/weibo/QWeiboSyncApi;->publishMsg(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/newsreader/weibo/QWeiboType$ResultType;)Ljava/lang/String;

    move-result-object v11

    .line 883
    :goto_0
    if-eqz v11, :cond_5

    .line 885
    new-instance v9, Lorg/json/JSONObject;

    invoke-direct {v9, v11}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 886
    .local v9, jobj:Lorg/json/JSONObject;
    const-string v3, "msg"

    invoke-virtual {v9, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "ok"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_1

    .line 887
    const/4 v3, 0x0

    iput v3, v10, Landroid/os/Message;->arg1:I
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 913
    .end local v0           #api:Lcom/netease/newsreader/weibo/QWeiboSyncApi;
    .end local v1           #customKey:Ljava/lang/String;
    .end local v2           #customSecrect:Ljava/lang/String;
    .end local v9           #jobj:Lorg/json/JSONObject;
    .end local v11           #response:Ljava/lang/String;
    :goto_1
    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->this$0:Lcom/netease/newsreader/activity/ShareToMicroBlog;

    iget-object v3, v3, Lcom/netease/newsreader/activity/ShareToMicroBlog;->reflashormoreDataHandler:Landroid/os/Handler;

    invoke-virtual {v3, v10}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 914
    return-void

    .line 880
    .restart local v0       #api:Lcom/netease/newsreader/weibo/QWeiboSyncApi;
    .restart local v1       #customKey:Ljava/lang/String;
    .restart local v2       #customSecrect:Ljava/lang/String;
    .restart local v11       #response:Ljava/lang/String;
    :cond_0
    :try_start_1
    iget-object v3, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->t:Ljava/lang/String;

    iget-object v4, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->s:Ljava/lang/String;

    iget-object v5, p0, Lcom/netease/newsreader/activity/ShareToMicroBlog$postEditMessage4QQ;->msg4QQ:Ljava/lang/String;

    .line 881
    const-string v6, ""

    sget-object v7, Lcom/netease/newsreader/weibo/QWeiboType$ResultType;->ResultType_Json:Lcom/netease/newsreader/weibo/QWeiboType$ResultType;

    .line 880
    invoke-virtual/range {v0 .. v7}, Lcom/netease/newsreader/weibo/QWeiboSyncApi;->publishMsg(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/newsreader/weibo/QWeiboType$ResultType;)Ljava/lang/String;

    move-result-object v11

    goto :goto_0

    .line 889
    .restart local v9       #jobj:Lorg/json/JSONObject;
    :cond_1
    const-string v3, "msg"

    invoke-virtual {v9, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "check sign error"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 890
    const/4 v3, 0x5

    iput v3, v10, Landroid/os/Message;->what:I

    .line 891
    const/4 v3, 0x1

    iput v3, v10, Landroid/os/Message;->arg1:I
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    .line 906
    .end local v0           #api:Lcom/netease/newsreader/weibo/QWeiboSyncApi;
    .end local v1           #customKey:Ljava/lang/String;
    .end local v2           #customSecrect:Ljava/lang/String;
    .end local v9           #jobj:Lorg/json/JSONObject;
    .end local v11           #response:Ljava/lang/String;
    :catch_0
    move-exception v8

    .line 908
    .local v8, e:Ljava/lang/Exception;
    invoke-virtual {v8}, Ljava/lang/Exception;->printStackTrace()V

    .line 909
    iput v12, v10, Landroid/os/Message;->arg1:I

    goto :goto_1

    .line 893
    .end local v8           #e:Ljava/lang/Exception;
    .restart local v0       #api:Lcom/netease/newsreader/weibo/QWeiboSyncApi;
    .restart local v1       #customKey:Ljava/lang/String;
    .restart local v2       #customSecrect:Ljava/lang/String;
    .restart local v9       #jobj:Lorg/json/JSONObject;
    .restart local v11       #response:Ljava/lang/String;
    :cond_2
    :try_start_2
    const-string v3, "errcode"

    invoke-virtual {v9, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "13"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    .line 894
    const/4 v3, 0x4

    iput v3, v10, Landroid/os/Message;->what:I

    goto :goto_1

    .line 896
    :cond_3
    const-string v3, "errcode"

    invoke-virtual {v9, v3}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    const-string v4, "0"

    invoke-virtual {v3, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_4

    .line 897
    const/4 v3, 0x0

    iput v3, v10, Landroid/os/Message;->arg1:I

    goto :goto_1

    .line 900
    :cond_4
    const/4 v3, 0x1

    iput v3, v10, Landroid/os/Message;->arg1:I

    goto :goto_1

    .line 903
    .end local v9           #jobj:Lorg/json/JSONObject;
    :cond_5
    const/4 v3, 0x1

    iput v3, v10, Landroid/os/Message;->arg1:I
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0

    goto :goto_1
.end method
